<!doctype HTML>
<meta charset="utf-8">
<title>Testcase for changing a valid &#x3c;use&#x3e; to a data URL:</title>
<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute">
<link rel="match" href="reference/green-100x100.html">
<script>
  function go() {
    const use = document.querySelector("use");
    use.setAttribute("href", "#orange-rect");
  }
</script>
<body onload="go()">
  <svg id="mySVG">
    <rect id="red" width="100" height="100" fill="red"></rect>
    <rect id="green" width="100" height="100" fill="green"></rect>
    <use x="100" y="0" href="#red"></use>
  </svg>
</body>
